package com.Ajava1704;

/**
 * @类名: com.Ajava1704
 * @作者: lgt
 * @创建时间: 2020-02-10 20:27
 * @描述:
 **/
public class Test0210 {

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("--------1--------");
            }
        });

        thread.start();
        thread.join();   //先走这个，再走主函数下面的输出，最后是线程

        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("--------2------");
            }
        });
        thread1.start();
        thread1.join();

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("--------3--------");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread2.start();


        System.out.println("***********555555**********");
    }
}
